package com.dong.util;

import java.util.List;

/**
 * @author xiaoDong
 * @version 1.0.0
 * @ClassName Page.java
 * @Description 用来存放分页的对象
 * @createTime 2024年04月16日 14:18:00
 */
public class Page<T> {
    //总数
    private int totalCount;
    //每页展示的数量
    private int count = 20;
    //当前的页数
    private int pageNum = 1;
    //总页数
    private int countPage;

    //当前页展示的数据
    private List<T> dataList;

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        if(totalCount>0){
            this.totalCount = totalCount;
            this.countPage = totalCount%count==0?totalCount/count:totalCount/count+1;
        }
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getCountPage() {
        return countPage;
    }

    public List<T> getDataList() {
        return dataList;
    }

    public void setDataList(List<T> dataList) {
        this.dataList = dataList;
    }
}
